package com.mvvm.store.roombatabase;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.mvvm.store.bean.basebean.ScanDeliveryBean;
import com.mvvm.store.bean.basebean.ScanStockBean;

import java.util.List;

/**
 * 标签存储
 */

@Dao
public interface ScanDeliveryDao {

    //查询标签是否存在
    @Query("SELECT * FROM ScanDeliveryBean WHERE lableNumber=:lableNumber")

    List<ScanDeliveryBean> getScanDeliveryBeanByLabelNumber(String lableNumber);

    //查询零件号是否存在
    @Query("SELECT * FROM ScanDeliveryBean WHERE oddNumber=:oddNumber")
    List<ScanDeliveryBean> getScanDeliveryBeanByOddNumber(String oddNumber);

    //新增扫码数据
    @Insert
    void insertAll(ScanDeliveryBean... stockUpInfoBean);

    //修改单挑记录
    @Update
    void updateStudent(ScanDeliveryBean... users);

    //删除对于的备案数据
    @Delete
    void delete(ScanDeliveryBean user);


    //根据id查询对于的物料信息
    @Query("SELECT *FROM ScanDeliveryBean WHERE sId=:sId")
    List<ScanDeliveryBean> getScanStockBeanById(int sId);
}
